home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
batch
/
batout13.zip
/
BATOUT.DOC
next >
Wrap
Text File
|
1992-10-31
|
4KB
|
129 lines
┌────────────┐
│ BATOUT.EXE │
└────────────┘
Batch File Exit Utility
Tom Kellen
ßETATech Computer Consulting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PURPOSE: To provide a timed exit or jump within a batch file based
on a keystroke.
INTRODUCTION:
This little ditty runs a timer to allow you a pause to exit a batch
file. I wrote this to use on my BBS machine as it loads a device
driver that disables the Ctrl/Break. The AUTOEXEC.BAT on the BBS
machine automatically loads the BBS, so what I needed was a utility
that would allow me to exit the batch file before Spitfire loads.
BatOut gives a delay to your batch files waiting for a key stroke.
If I am not there and the machine reboots, the AUTOEXEC runs BatOut
and it just times out loading the BBS. If I am there and have
rebooted the machine to do some maintenance and don't want the BBS
loaded, I just hit a key and BatOut aborts the batch file.
Here is the tail end of my BBS machine's AUTOEXEC.BAT:
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
C:
CD\SF
CLS
ECHO Should the BBS be loaded?
ECHO .
@BatOut 10
IF ErrorLevel 1 GOTO EXIT
BOOTLOG C:\SF\WORK\CALLERS.LOG
SF
:EXIT
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
INSTALLATION:
Place BATOUT.EXE in a subdirectory that is somewhere on the path.
That is all there is to it.
OPERATION:
BatOut takes one required command line parameter, and two optional
ones. The required parameter is the number of seconds to wait. This
must be between 0 and 99. BatOut will then display the seconds
counting down. If you do nothing the program will halt at the number
of seconds you specified with an ErrorLevel of 0. If you press the
<Escape> key, BatOut will exit immediately with an ErrorLevel of 0.
This effectively continues your batch file immediately. If you press
any other key, BatOut exits with an ErrorLevel of 1. You then check
for this ErrorLevel and use a GOTO statement to skip to the end of the
batch file.
BatOut can also be used for branching in batch files. If there was
a command in a batch file that you only want to run occasionally, you
can use BatOut to jump to a label beyond that command, just by hitting
a key.
BatOut also takes 2 optional parameters. The first one is /T. This
parameter stops BatOut from displaying the program name and copyright.
Please honor the copyright, but I can understand some folks wanting
a cleaner display.
The second parameter is /C. Using /C suppresses the display of the
count down timer. BatOut still waits the designated time, but there
is no display of the remaining seconds.
It's really nothing fancy, just a timer that you might find useful.
I've included a little demo batch file to show how it works. Try
doing nothing, then try it pressing any key. Now try it pressing the
<Escape> key.
EPILOGUE:
This is a Free utility. I retain the copyright, but you may use it
to your heart's content. If you find this utility of use, you can
drop me a note on my BBS or route me a message at RIME Node ->PARADIGM
letting me know that you find it of value too. Of course if you felt
like sending .50 or a dollar, that certainly would not be turned down.
AUTHOR CONTACT:
Problems, solutions, kudos and ideas are welcomed. I can be reached
at the following:
The Paradigm BBS ßETATech Computer Consulting
404/671-1581 P. O. Box 566742
1200-19,200 Baud 24 Hrs/Day Atlanta, GA 31156-6013
DISCLAIMER:
Use of this program acknowledges this disclaimer of warranty: "This
program is supplied as is. ßETATech Computer Consulting disclaims all
warranties, express or implied, including, without limitation, the
warranties of merchantability and of fitness of this program for any
purpose. ßETATech Computer Consulting assumes no liability for
damages direct or consequential, which may result from the use of this
program."
REVISION HISTORY:
15-NOV-1990 v1.0 Initial Release.
01-DEC-1990 v1.1 Recompiled with Turbo Pascal v6.0
10-FEB-1992 v1.2 Added /C and /T command line parameters.
31-OCT-1992 V1.3 Code optimizations resulting in smaller .EXE